package com.hdaccp.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class WelcomeController {
    @RequestMapping("/welcome")
    public String welcome(@RequestParam(required = false,defaultValue = "小明") String username){
        System.out.println("username = " + username);
        return "welcome" ;
    }

    @RequestMapping("/hi")
    public String hi(@RequestParam(required = false,defaultValue = "20") int age){
        System.out.println("age = " + age);
        return "success" ;
    }

    @RequestMapping(value = {"hello","hello1","hello2"},method = {RequestMethod.POST,RequestMethod.GET})
    public String hello(){
        System.out.println("welcome -> hello");
        return "success" ;
    }

    public void show(){
        System.out.println("show................");
    }

    public void show1(){
        System.out.println("show................");
    }

    public void show2(){
        System.out.println("show................");
    }
}
